#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/711/learning/");

    vector<int> days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int y = 1777, m = 4, d = 30;

    int n = 8112;

    while(n) {
        n--;
        d++;
        if(d > days[m]) {
            d = 1;
            m++;
            if(m > 12) {
                m = 1;
                y++;
                if((y % 4 == 0 && y % 100) || (y % 400 == 0))
                    days[2] = 29;
                else
                    days[2] = 28;
            }
        }
    }

    printf("%04lld-%02lld-%02lld", y, m, d);

    return 0;
}

